<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8" />
  <meta name="renderer" content="webkit" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  <meta name="Keywords" content="${firstPage.keywords}" />
  <meta name="description" content="${firstPage.description}" />
  <title>小窝-后台-博客列表</title>
  <link rel="stylesheet" type="text/css" href="${firstPage.cdnBootstrapCss}" />
</head>
<body>

<#include "header.ftl" >

<div class="container">
    <p></p>
    <h2 class="text-center">博客列表</h2>

    <input class="btn btn-primary" type="button" onclick="update()" value="新建博客">
    <p></p>
    <p>当前共：${total} 条博客</p>

    <table class="table table-backgroud table-hover table-bordered table-striped">
        <thead>
        <tr>
          <th>博客id</th>
          <th>标题</th>
          <th>关键字</th>
          <th>设置</th>
        </tr>
        </thead>
        <#list blogs as blog>
        <tr>
          <td>${blog.bid}</td>
          <td>${blog.title}</td>
          <td>${blog.keyword}</td>
          <td>
            <a href="/adminLove/blog?bid=${blog.bid}">编辑</a>
          </td>
        </tr>
        </#list>
    </table>

    <ul id="pagination" class="pagination">
        <li class="page-item head"><a class="page-link" href="#">首</a></li>
        <li class="page-item disabled morehead d-none d-sm-inline-block"><a class="page-link">...</a></li>
        <li class="page-item page-2 d-none d-sm-block"><a class="page-link">1</a></li>
        <li class="page-item page-1"><a class="page-link">2</a></li>
        <li class="page-item currentpage active"><a class="page-link">1</a></li>
        <li class="page-item page_1"><a class="page-link">3</a></li>
        <li class="page-item page_2 d-none d-sm-block"><a class="page-link">4</a></li>
        <li class="page-item disabled moretail d-none d-sm-inline-block"><a class="page-link">...</a></li>
        <li class="page-item tail"><a class="page-link" href="#">尾</a></li>
    </ul>
</div>

<script type="text/javascript" src="${firstPage.cdnJqueryJs}"></script>
<script type="text/javascript" src="${firstPage.cdnBootstrapJs}"></script>
<script type="text/javascript" src="/js/lib/pagetool.js"></script>
<script type="text/javascript">
    setPage(Number(${curpage}), Number(${allpage}), "getMsg");
    function getMsg(p) {
        location.href="/adminLove/blogList?page="+p;
    }
    function update() {
        window.location="/adminLove/blog?bid=";
    }
</script>
</body>
</html>